package com.topnav.mc.uitls;

import com.js.lib.result.ApiResult;
import com.js.lib.result.Result;
import com.topnav.mc.exception.ExceptionMsg;

/**
 * @Author: kenny
 * @Date: 2024/3/13 9:13
 */
public class ResultErrorUtil {

    public static Result byExceptionMsg(ExceptionMsg e){
        return Result.error(e.getCode(),e.getDesc());
    }

    public static Result byExceptionMsg(ExceptionMsg e,String ... extMsg){
        return Result.error(e.getCode(),e.getFillDesc(extMsg));
    }

    public static ApiResult apibyExceptionMsg(ExceptionMsg e){
        return ApiResult.error(e.getCode(),e.getDesc());
    }
}
